<?php
$item_url = $_GET['var2'];
$re_item = $db->select("select * from news_item where titleurl = '$item_url' ");
$tt_item = $db->fetch($re_item);
$sql_list = "select * from news_item where id NOT IN ( " . $tt_item['id'] . " ) order by orderId, id desc limit 4";
$qr_list = $db->select($sql_list);
?>
<div class="w700">
    <div class="title"><?= $co_news['titlemenu' . $hg] ?></div>
    <div class="news-detail">
        <div class="tit"><?= $tt_item['title' . $hg] ?></div>
        <div class="content">
            <?= $tt_item['content' . $hg] ?>
        </div>

        <div class="other">
            <div class="tit" ><?= ($hg == "") ? 'Other news' : 'Các tin khác' ?></div>
            <ul>
                <?php
                while ($tt_list_other = $db->fetch($qr_list)) {
                    ?>
                    <li><a href="<?= APPLICATION_URL ?>news-detail/<?= $tt_list_other['titleurl'] ?>.html"><?= $tt_list_other['title' . $hg] ?></a></li>
                    <?php
                }
                ?>
            </ul>
        </div>
    </div>

</div>
<div class="w260 ml20">
    <div class="title"><?= $co_tip['titlemenu' . $hg] ?></div>
    <ul class="s-list">
        <?php
        $i = 0;
        require_once ("library/paging.cls.php");
        $paging = new paging();
        $curpg = 1; //$_GET['var2'];
        $curpg = (isset($curpg)) ? $curpg : 1;
        $gotopage = APPLICATION_URL . "tip";
        $perpage = 3;
        $pagecount = 6;

        $curpg = 1;

        $sql = "select * from tip_item   ";

        $query = $db->select($sql);
        $totalrows = $db->numrows($query);

        $sql_list = "select * from tip_item  order by orderId, id desc limit " . (($curpg - 1) * $perpage) . ", " . $perpage;
        $qr_list = $db->select($sql_list);
        $num_list = $db->numrows($qr_list);

        while ($tt_list = $db->fetch($qr_list)) {
            $i++;
            if ($i != $num_list)
                $listborder = " border-bottom:#d7d7d7 1px dotted; ";
            else
                $listborder = "";
            ?>
            <li>
                <a href="<?= APPLICATION_URL ?>news-detail/<?= $tt_list['titleurl'] ?>.html">
                    <img class="image" src="<?= APPLICATION_URL ?>tip-img/<?= $tt_list['image'] ?>" alt="tip" />
                    <div class="desc">
                        <div class="tit"><?= $tt_list['title' . $hg] ?></div>
                        <div><?= $tt_list['description' . $hg] ?></div>
                    </div>
                    <div class="clear"></div>
                </a>
            </li>
        <?php } ?>
    </ul>
</div>
